package com.guiassysdesigners.service;

import java.util.List;

import com.guiassysdesigners.dao.SuggestionDao;
import com.guiassysdesigners.model.Suggestion;

public interface SuggestionManager extends GenericManager<Suggestion, Long> {

    /**
     * Convenience method for testing - allows you to mock the DAO and set it on an interface.
     * @param suggestionDao the SuggestionDao implementation to use
     */
    void setSuggestionDao(SuggestionDao suggestionDao);

    /**
     * Retrieves a suggestion by suggestionId.  An exception is thrown if suggestion not found
     *
     * @param suggeestionId the identifier for the suggestion
     * @return Suggestion
     */
    Suggestion getSuggestion(String suggestionId);

    /**
     * Retrieves a list of all suggestions.
     * @return List
     */
    List<Suggestion> getListSuggestion();

    /**
     * Saves a suggestion's information.
     *
     * @param suggestion's information
     * @return updated suggestion object
     */
    Suggestion saveSuggestion(Suggestion suggestion)throws FormValidationException;

    /**
     * Removes a suggestion from the database
     *
     * @param suggestion to remove
     */
    void removeSuggestion(Suggestion suggestion);

    /**
     * Removes a suggestion from the database by their suggestionId
     *
     * @param suggestionId the suggestion's id
     */
    void removeSuggestion(String suggestionId);

    /**
     * Search a suggestion for search terms.
     * @param searchTerm the search terms.
     * @return a list of matches, or all if no searchTerm.
     */
    List<Suggestion> search(String searchTerm);
	
}
